package com.zhn.evsi.client;

import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.annotation.*;
import com.zhn.evsi.domain.dto.evsi.EvsiCharacterLocationDTO;
import com.zhn.evsi.domain.dto.evsi.EvsiCharacterOnlineDTO;
import com.zhn.evsi.domain.dto.evsi.EvsiCharacterShipDTO;
import com.zhn.evsi.domain.dto.evsi.character.*;
import com.zhn.evsi.interceptor.TokenExceptionInterceptor;
import com.zhn.evsi.interceptor.TokenInterceptor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@BaseRequest(baseURL = "${eveData}${eveDataSns}", interceptor = TokenExceptionInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000")
public interface CharacterClient {


    /**
     * 当前地址
     * */
    // https://esi.evetech.net/latest/characters/2119634223/location/?datasource=tranquility&token=1%7CCfDJ8LAoxfuX0s1GlKTIRpDOTgr0TbBDvGwrtgwm9ycLD84BZppZfGC%2FBFyyXtMCMNNojKZo0%2BjNeCh%2FIJw3ck5HVBmyH31BfRJ7K7gMZ5RSFG03inPtro1jTbbNAZ0IlmsZH6ZB5qF7VB%2Bs4qfLjCc5EgDUAozksf4rrmdZrTV3U2CQ
    @Request(
            url = "/characters/{characters}/location/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    EvsiCharacterLocationDTO location(@Var("characters") Integer characters);

    /**
     * 当前是否在线
     * */
    // https://esi.evetech.net/latest/characters/2119634223/online/?datasource=tranquility&token=1%7CCfDJ8LAoxfuX0s1GlKTIRpDOTgpkGyG%2F3mfGSy8f6qqHjLMySn5MUF9u%2BgpJG6q3gFrhvzYG0xTMbGrFIlmHVG4rpt%2BVIE6635n2sYoVm63Yybj7rkgD0BswOAe05IsvRFY6QXVNwDmb8RO5zYtPZ3GESWIe0HDKChO0yiyE5XPD84sd
    @Request(
            url = "/characters/{characters}/online/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    EvsiCharacterOnlineDTO online(@Var("characters") Integer characters);

    /**
     * 获取当前舰船信息
     * */
    // https://esi.evetech.net/latest/characters/2119634223/ship/?datasource=tranquility&token=1%7CCfDJ8LAoxfuX0s1GlKTIRpDOTgpkGyG%2F3mfGSy8f6qqHjLMySn5MUF9u%2BgpJG6q3gFrhvzYG0xTMbGrFIlmHVG4rpt%2BVIE6635n2sYoVm63Yybj7rkgD0BswOAe05IsvRFY6QXVNwDmb8RO5zYtPZ3GESWIe0HDKChO0yiyE5XPD84sd
    @Request(
            url = "/characters/{characters}/ship/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    EvsiCharacterShipDTO ship(@Var("characters") Integer characters);

    /**
     * 研究
     * */
    // https://esi.evetech.net/latest/characters/2119634223/agents_research/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/agents_research/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<JSONObject> agentsResearch(@Var("characters") Integer characters);


    /**
     * 蓝图
     * */
    // https://esi.evetech.net/latest/characters/2119634223/blueprints/?datasource=tranquility&page=1&token=
    @Request(
            url = "/characters/{characters}/blueprints/?datasource=tranquility&page={page}",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<EvsiCharacterBlueprintsDTO> blueprints(@Var("characters") Integer characters, @Var("page") Integer page);

    /**
     * 获取军团历史
     * */
    // https://esi.evetech.net/latest/characters/2119634223/corporationhistory/?datasource=tranquility
    @Request(
            url = "/characters/{characters}/corporationhistory/?datasource=tranquility",
            type = "GET"
    )
    List<EvsiCharacterCorporationHistoryDTO> corporationHistory(@Var("characters") Integer characters);

    /**
     * 跳跃疲劳
     * */
    // https://esi.evetech.net/latest/characters/2119634223/fatigue/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/fatigue/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    EvsiCharacterFatigueDTO fatigue(@Var("characters") Integer characters);

    /**
     * 奖牌
     * */
    //https://esi.evetech.net/latest/characters/2119634223/medals/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/medals/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<JSONObject> medals(@Var("characters") Integer characters);

    /**
     * 角色通知
     * */
    // https://esi.evetech.net/latest/characters/2119634223/notifications/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/notifications/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<EvsiCharacterNotificationsDTO> notifications(@Var("characters") Integer characters);

    /**
     * 联系人通知
     * */
    // https://esi.evetech.net/latest/characters/2119634223/notifications/contacts/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/notifications/contacts/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<EvsiCharacterNotificationContactsDTO> notificationContacts(@Var("characters") Integer characters);

    /**
     * 角色肖像
     * */
    // https://esi.evetech.net/latest/characters/2119634223/portrait/?datasource=tranquility
    @Request(
            url = "/characters/{characters}/portrait/?datasource=tranquility",
            type = "GET"
    )
    EvsiCharacterPortraitDTO portrait(@Var("characters") Integer characters);

    /**
     * 角色所在军团权限
     * */
    // https://esi.evetech.net/latest/characters/2119634223/roles/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/roles/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    EvsiCharacterRolesDTO roles(@Var("characters") Integer characters);

    /**
     * 角色榜单
     * */
    // https://esi.evetech.net/latest/characters/2119634223/standings/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/standings/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<EvsiCharacterStandingsDTO> standings(@Var("characters") Integer characters);

    /**
     * 军团标题
     * */
    // https://esi.evetech.net/latest/characters/2119634223/titles/?datasource=tranquility&token=
    @Request(
            url = "/characters/{characters}/titles/?datasource=tranquility",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<JSONObject> titles(@Var("characters") Integer characters);

}
